<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Budget.aspx.vb" MasterPageFile="~/Admin/Admin.master" Inherits="admin_Budget" Title="Admin - Spending Plan Categories" %>
<%@ Register Assembly="InputControls" Namespace="InputControls" TagPrefix="cc2" %>
<%@ Register Src="SubNavControls/BudgetSubNavControl.ascx" TagName="BudgetSubNavControl" TagPrefix="uc1" %>
    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
 <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
<uc1:BudgetSubNavControl ID="SubNavCtrl" runat="server" />
    <asp:ObjectDataSource ID="BudgetObjectDataSource" runat="server"
            DeleteMethod="RemoveInstance" InsertMethod="SaveInstance" SelectMethod="ListBySort" 
            TypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategory" 
            DataObjectTypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategory"
            UpdateMethod="UpdateInstance" SortParameterName="sortExpr" ></asp:ObjectDataSource>
        
        <asp:ObjectDataSource ID="NewObjectDataSource" runat="server" DataObjectTypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategory"
            InsertMethod="SaveInstance" TypeName="Cdm.DataCore.LookupTables.LuAdminBudgetCategory" SelectMethod="getNew">
        </asp:ObjectDataSource>        
<table cellpadding="0" cellspacing="0">
<tr><td style="width:20px;" rowspan="6"></td>
<td><h1><a id="pagecontent">Admin - Spending Plan Categories</a></h1>
</td></tr>    
<tr><td><cc2:ValidationErrorSummary ID="ErrorSummary" runat="server" Message="" Visible="false" /></td></tr>
<tr><td><asp:UpdatePanel Id="GridUpdatePanel" runat="server">
           <ContentTemplate>
        <cc2:ScrollingGridView ID="BudgetScrollingGridView" runat="server" CssClass="gridOffsetSmall" HorizontalAlign="center" CellPadding="5" ToolTip="180"
            AutoGenerateColumns="False" IsFixedColumn="true" DataSourceID="BudgetObjectDataSource" DataKeyNames="Id" BorderColor="#21334B" BorderStyle="Solid" GridLines="Vertical" EmptyDataText="No data.  Select <b>New</b> below to add an item." AllowSorting="true">
        <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
        <RowStyle CssClass="adminColumnStyle" />
            <Columns>
                <asp:TemplateField HeaderText="Display Categories" SortExpression="DisplayName">
                    <ItemStyle Width="310px" />
                    <HeaderStyle Width="316px" />
                    <ItemTemplate><%# Eval("DisplayName") %></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDisplay" CssClass="formNoWidth" runat="server" Text='<%# Bind("DisplayName") %>' Width="300"></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Display Order (Top to Bottom)" SortExpression="DisplayOrder" ItemStyle-HorizontalAlign="center">
                     <ItemStyle Width="100px" />
                    <HeaderStyle Width="100px" />
                    <ItemTemplate><%#Eval("DisplayOrder")%></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="DisplayOrderTextBox" CssClass="formNoWidth" runat="server" Text='<%# Bind("DisplayOrder") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="# of Lines" SortExpression="NumberofLines" ItemStyle-HorizontalAlign="center">
                    <ItemStyle Width="100px" />
                    <HeaderStyle Width="100px" />
                    <ItemTemplate><%#Eval("NumberOfLines")%></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="NumberOfLinesTextBox" CssClass="formNoWidth" runat="server" Text='<%# Bind("NumberOfLines") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Is Active" SortExpression="IsActive" ItemStyle-HorizontalAlign="Center">
                    <HeaderStyle Width="100px" />
            <ItemStyle HorizontalAlign="center" Width="100px" />
            <ItemTemplate>
                <asp:Image ID="IsActiveImage" runat="server" ImageUrl="~/images/blankcheck.gif" />
            </ItemTemplate>
            <EditItemTemplate>
                <asp:CheckBox ID="EditActiveCheckbox" runat="server" Checked='<%#Bind("IsActive") %>' />
            </EditItemTemplate>
        </asp:TemplateField>
        
         <asp:TemplateField HeaderText="Use Aggregates" SortExpression="UseAggregateExpenditures" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="60px">
            <ItemStyle HorizontalAlign="center" Width="100px" />
            <HeaderStyle Width="100px" />
            <ItemTemplate>
                <asp:Image ID="UseAggregateImage" runat="server" ImageUrl="~/images/blankcheck.gif" />
            </ItemTemplate>
            <EditItemTemplate>
                <asp:CheckBox ID="EditAggregateCheckbox" runat="server" Checked='<%#Bind("UseAggregateExpenditures") %>' />
            </EditItemTemplate>
        </asp:TemplateField>
        
            
                
                <asp:CommandField ShowEditButton="True" HeaderText="Action" AccessibleHeaderText="Action">
                    <ItemStyle HorizontalAlign="Center" Width="75px" />
                    <HeaderStyle Width="105px" />
                </asp:CommandField>
            </Columns>
        <AlternatingRowStyle BackColor="#E8ECF4" />
        <EmptyDataRowStyle CssClass="headerStyle" BackColor="#C3CAD4" />
        </cc2:ScrollingGridView>
        </ContentTemplate>
        </asp:UpdatePanel>
       </td></tr>
<tr><td>
        <asp:DetailsView ID="NewDetailsView" runat="server" CssClass="gridOffset" Width="825px" AutoGenerateRows="False" DataSourceID="NewObjectDataSource" DefaultMode="Insert" GridLines="none" Visible="false">
            <Fields>
                <asp:BoundField DataField="DisplayName" HeaderText="Display Name:" HeaderStyle-CssClass="adminLabel" SortExpression="Display Name" />
                <asp:BoundField DataField="DisplayOrder" HeaderText="Display Order:" HeaderStyle-CssClass="adminLabel" SortExpression="Display Order" />
                <asp:BoundField DataField="NumberOfLines" HeaderText="Number of Lines:" HeaderStyle-CssClass="adminLabel" SortExpression="Number of Lines" />
                <asp:CheckBoxField DataField="IsActive" HeaderText="Is Active:" HeaderStyle-CssClass="adminLabel" SortExpression="Is Active" />
            </Fields>
        </asp:DetailsView>
</td></tr>
<tr><td><asp:Button ID="AddButton" runat="server" Text="Add" Visible="false" /></td></tr>
<tr><td><asp:Button ID="SubmitButton" runat="server" Text="Submit" Visible="false" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" Visible="false" /></td></tr>
</table>    
</asp:Content>
